import { createRouter,createWebHistory } from "vue-router";

//导入组件
import LoginVue from "@/views/Login.vue";
import LayoutVue from "@/views/Layout.vue";
import HomeVue from "@/views/Home.vue";
import CarVue from "@/views/driverCar/Car.vue";
import DriverVue from "@/views/driverCar/Driver.vue";
import OrderAllocationVue from "@/views/order/OrderAllocation.vue";
import OrderDesVue from "@/views/order/OrderDes.vue";
import OrderListVue from "@/views/order/OrderList.vue";
import ParentVue from "@/views/parentStudent/Parent.vue";
import StudentVue from "@/views/parentStudent/Student.vue";
import RouteVue from "@/views/routeStation/Route.vue";
import StationVue from "@/views/routeStation/Station.vue";
import AboutUsVue from "@/views/setting/AboutUs.vue"
import AdminVue from "@/views/setting/Admin.vue"
/* import AdminManageVue from "@/views/setting/AdminManage.vue" */
import AnnouncementQuestionVue from "@/views/setting/AnnouncementQuestion.vue"
import BackdropVue from "@/views/setting/Backdrop.vue"
import FeedbackVue from "@/views/setting/Feedback.vue"
import LogVue from "@/views/setting/Log.vue"
import SMStemplateVue from "@/views/setting/SMStemplate.vue"
import UserAvatarVue from "@/views/user/UserAvatar.vue";
import UserInfoVue from "@/views/user/UserInfo.vue";
import UserResetPasswordVue from "@/views/user/UserResetPassword.vue";

//定义路由关系
const routes = [
    {path:'/login', component: LoginVue},
    {path:'/', component: LayoutVue,redirect:'/home',
    //子路由
    children:[
        {path:'/home', component:HomeVue},
        {path:'/driverCar/car', component:CarVue},
        {path:'/driverCar/driver', component:DriverVue},
        {path:'/Order/allocation', component:OrderAllocationVue},
        {path:'/Order/des', component:OrderDesVue},
        {path:'/Order/list', component:OrderListVue},
        {path:'/parentStudent/parent', component:ParentVue},
        {path:'/parentStudent/student', component:StudentVue},
        {path:'/routeStation/route', component:RouteVue},
        {path:'/routeStation/station', component:StationVue},
        {path:'/setting/aboutUs', component:AboutUsVue},
        {path:'/setting/admin', component:AdminVue},
/*         {path:'/setting/adminManage', component:AdminManageVue}, */
        {path:'/setting/announcementQuestion', component:AnnouncementQuestionVue},
        {path:'/setting/backdrop', component:BackdropVue},
        {path:'/setting/feedback', component:FeedbackVue},
        {path:'/setting/log', component:LogVue},
        {path:'/setting/SMStemplate', component:SMStemplateVue},
        // {path:'/user/avatar', component:UserAvatarVue}
        {path:'/user/info', component:UserInfoVue}
        // {path:'/user/resetPassword', component:UserResetPasswordVue}
    ]
}
]

//创建路由对象
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router;